package demo;

import application.MazeProblem;
import zhengqc.common.Tuple;

import java.util.LinkedList;

public class DemoMazeProblem {
    public static void test(String filename, MazeProblem mazeProblem) {
        mazeProblem.setMaze(filename);
        mazeProblem.printMaze();
        LinkedList<Tuple<Integer, Integer>> path = mazeProblem.getShortestPath();
        System.out.print("path: " + path.get(0));
        for (int i = 0; i < path.size(); ++i) {
            if (i % 8 == 7) {
                System.out.println();
            }
            System.out.print(" => " + path.get(i));
        }
        System.out.println();
    }
    public static void main(String[] args) {
        MazeProblem mazeProblem = new MazeProblem();
        test("files/maze/m1.txt", mazeProblem);
        System.out.println("================================");
        test("files/maze/m2.txt", mazeProblem);
    }
}
